﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IServices;
using Models;
using System.Data;

namespace ImpServices
{
    public class CategoryServices : ICategoryServices
    {
        public List<CategoryInfo> GetAll()
        {
            List<CategoryInfo> listCate = new List<CategoryInfo>();
            string strSql = "select * from category";
            DataTable dtCategory = SqlServices.SqlHelper.ExecuteDataTable(strSql, null);
            foreach (DataRow row in dtCategory.Rows)
            {
                CategoryInfo categoryInfo = new CategoryInfo();
                categoryInfo.CategoryID = row["id"].ToString();
                categoryInfo.CategoryName = row["categoryName"].ToString();
                categoryInfo.LinkUrl = row["linkUrl"].ToString();
                categoryInfo.ParentID = row["parentID"].ToString();
                listCate.Add(categoryInfo);
            }
            return listCate;
        }

        public int GetCount(Models.CategoryInfo categoryInfo)
        {
            throw new NotImplementedException();
        }

        public int GetById(int id)
        {
            throw new NotImplementedException();
        }

        public int Update(Models.CategoryInfo categoryInfo)
        {
            throw new NotImplementedException();
        }

        public int Delete(params int[] ids)
        {
            throw new NotImplementedException();
        }

        public int Insert(Models.CategoryInfo categoryInfo)
        {
            throw new NotImplementedException();
        }
    }
}
